#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
int my_strncmp(char* str1, char* str2, int n)
{
	assert(str1 && str2);
	while (*str1!='\0' && *str2 != '\0' && n--)
	{
		if (*str1 != *str2)
			return *str1 - *str2;
		str1 += 1, str2 += 1;
	}
	if (*str1 == '\0' || *str2 == '0')
		return *str1 - *str2;
	else
		return 0;
}
int my_memcmp(void* p1, void* p2, size_t n)
{
	assert((char*)p1 && (char*)p2);
	while (n--)
	{
		if (*(char*)p1 != *(char*)p2)
			return *(char*)p1 - *(char*)p2;
		(char*)p1 += 1, (char*)p2 += 1;
	}
	return 0;
}
void my_memset(void* p1, int x, size_t n)
{
	assert(p1);
	while (n--)
	{
		*(char*)p1 = x;
		(char*)p1 += 1;
	}
}
int main()
{
	char st[] = "kcshjh";
	char stm[] = "kcshkferu";
	int a = 256, b = 0;
	int* pa = &a, * pb = &b;
	my_memset(stm, 65+10, strlen(stm));
	printf("%s", stm);
	return 0;
}